<?php 
class Mdtemplate extends CI_Model{
	public function __construct(){
		parent::__construct();
		$this->load->database();
	}
	public function listTemplate(){
		//$this->db->select("project_id");
		$query  = $this->db->get("template");
		$result = $query->result_array();
		return $result;
	}
	public function templateById($project_id){
	
		$this->db->where("project_id",$project_id);
		$query = $this->db->get("template");
		$result = $query->row_array();
		return $result;
	}
	public function addTemplate($data){
		$this->db->insert("template",$data);
	}
	public function updateTemplate($project_id,$data){
		$this->db->where("project_id",$project_id);
		$this->db->update("template",$data);
	}
	
	public function deleteTemplate($project_id){
		$this->db->where("project_id",$project_id);
		$this->db->delete("template");
	}
	
}

?>